<template>
	<view class="content">
		<u-tabbar
			:value="tabbarIndex"
			:placeholder="false"
			@change="changeTab"
			:fixed="true"
			:safeAreaInsetBottom="false"
			activeColor="#f0ad4e"
		>
			<u-tabbar-item v-for="(item, index) in list" :key="index" :text="item.text" :icon="item.icon" ></u-tabbar-item>
		</u-tabbar>
	</view>
</template>

<script>
	export default {
		props: {
            tabbarIndex: {
                type: Number,
				default: 0
            },
        },
		data() {
			return {
	
				list: [
					{
						pagePath: "/pages/index/index",
						text: "广场",
						icon: 'arrow-up-fill'
					},
					{
						pagePath: "/pages/calendar/calendar",
						text: "日期",
						icon: 'order'
					},
					{
						pagePath: "/pages/partner/partner",
						text: "找搭子",
						icon: 'plus-circle-fill'
					},
					{
						pagePath: "/pages/user/user",
						text: "我的",
						icon: 'account'
					}
				]
			}
		},
		methods: {
			changeTab(index) {
				uni.switchTab({
					url: this.list[index].pagePath
				});
			}
		},
		onLoad() {
			
		},
	}
</script>

<style>
	
</style>
